package com.sl.au.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.ProductPlanSonView;

@Transactional(readOnly = true)
public interface ProductPlanSonViewRepository extends JpaRepository<ProductPlanSonView, String>{
	@Query("select n from ProductPlanSonView n where n.opProductPlanId =?1")
	Page<ProductPlanSonView> getPage(int key,Pageable pageable);
	@Query("select count(*) from ProductPlanSonView n where n.opProductPlanId =?1")
	long getCount(int key);
	
	@Query("select n from ProductPlanSonView n ")
	Page<ProductPlanSonView> getPage(Pageable pageable);
	@Query("select count(*) from ProductPlanSonView n ")
	long getCount();
}
